﻿using Admin.NET.Core;
using System.ComponentModel.DataAnnotations;

namespace Admin.NET.Application;

    /// <summary>
    /// 接收的SocketDatat基础输入参数
    /// </summary>
    public class ReceiveDataBaseInput
    {
        /// <summary>
        /// 版本
        /// </summary>
        public virtual byte? Version { get; set; }
        
        /// <summary>
        /// 命令
        /// </summary>
        public virtual byte? Cmd { get; set; }
        
        /// <summary>
        /// 路由ID
        /// </summary>
        public virtual int? RouteId { get; set; }
        
        /// <summary>
        /// 盲板ID
        /// </summary>
        public virtual int? BlindId { get; set; }
        
        /// <summary>
        /// NC空白
        /// </summary>
        public virtual Int16? Blank { get; set; }
        
        /// <summary>
        /// 管道
        /// </summary>
        public virtual byte? Pipe { get; set; }
        
        /// <summary>
        /// 
        /// </summary>
        public virtual byte? Snr { get; set; }
        
        /// <summary>
        /// 
        /// </summary>
        public virtual byte? Rssi { get; set; }
        
        /// <summary>
        /// 
        /// </summary>
        public virtual byte? Rssiflag { get; set; }
        
        /// <summary>
        /// NC空白
        /// </summary>
        public virtual Int16? Blank2 { get; set; }
        
        /// <summary>
        /// unix时间戳
        /// </summary>
        public virtual int? Timetick { get; set; }
        
        /// <summary>
        /// 时间
        /// </summary>
        public virtual DateTime? EventTime { get; set; }
        
        /// <summary>
        /// 
        /// </summary>
        public virtual byte? Online { get; set; }
        
        /// <summary>
        /// 
        /// </summary>
        public virtual Int16? Onnet { get; set; }

    /// <summary>
    /// 有效数据长度N
    /// </summary>
    public virtual Int16? Datalen { get; set; }

    /// <summary>
    /// 有效数据
    /// </summary>
    public virtual string? Data { get; set; }
    /// <summary>
    /// 有效数据 bit
    /// </summary>
    public virtual string? Data2 { get; set; }


    /// <summary>
    /// 原始数据
    /// </summary>
    public virtual string? AllData { get; set; }/// <summary>
                                             /// 创建时间
                                             /// </summary>
    public virtual DateTime? CreateTime { get; set; }
        
        /// <summary>
        /// 更新时间
        /// </summary>
        public virtual DateTime? UpdateTime { get; set; }
        
        /// <summary>
        /// 创建者Id
        /// </summary>
        public virtual long? CreateUserId { get; set; }
        
        /// <summary>
        /// 创建者姓名
        /// </summary>
        public virtual string? CreateUserName { get; set; }
        
        /// <summary>
        /// 修改者Id
        /// </summary>
        public virtual long? UpdateUserId { get; set; }
        
        /// <summary>
        /// 修改者姓名
        /// </summary>
        public virtual string? UpdateUserName { get; set; }
        
        /// <summary>
        /// 软删除
        /// </summary>
        public virtual byte IsDelete { get; set; }
        
    }

    /// <summary>
    /// 接收的SocketDatat分页查询输入参数
    /// </summary>
    public class ReceiveDataInput : BasePageInput
    {
        /// <summary>
        /// 关键字查询
        /// </summary>
        public string? SearchKey { get; set; }

        /// <summary>
        /// 版本
        /// </summary>
        public byte? Version { get; set; }
        
        /// <summary>
        /// 命令
        /// </summary>
        public byte? Cmd { get; set; }
        
        /// <summary>
        /// 时间
        /// </summary>
        public DateTime? EventTime { get; set; }
        
        /// <summary>
         /// 时间范围
         /// </summary>
         public List<DateTime?> EventTimeRange { get; set; } 
    }

    /// <summary>
    /// 接收的SocketDatat增加输入参数
    /// </summary>
    public class AddReceiveDataInput : ReceiveDataBaseInput
    {
        /// <summary>
        /// 软删除
        /// </summary>
        [Required(ErrorMessage = "软删除不能为空")]
        public override byte IsDelete { get; set; }
        
    }

    /// <summary>
    /// 接收的SocketDatat删除输入参数
    /// </summary>
    public class DeleteReceiveDataInput : BaseIdInput
    {
    }

    /// <summary>
    /// 接收的SocketDatat更新输入参数
    /// </summary>
    public class UpdateReceiveDataInput : ReceiveDataBaseInput
    {
        /// <summary>
        /// 主键Id
        /// </summary>
        [Required(ErrorMessage = "主键Id不能为空")]
        public long Id { get; set; }
        
    }

    /// <summary>
    /// 接收的SocketDatat主键查询输入参数
    /// </summary>
    public class QueryByIdReceiveDataInput : DeleteReceiveDataInput
    {

    }
